#include<iostream>
#include<set>
#include<map>
#include<string>
using namespace std;

int main()
{
	/*set<int> s;
	s.insert(5);
	s.insert(4);
	s.insert(6);
	s.insert(7);
	s.insert(2);
	s.insert(6);
	s.insert(3);
	s.insert(1);

	set<int>::iterator it = s.begin();
	while (it != s.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	set<int> s1(s.begin(), s.end());
	for (auto e : s1)
	{
		cout << e << " ";
	}
	cout << endl;

	set<int> s2(s1);
	for (auto e : s2)
	{
		cout << e << " ";
	}
	cout << endl;*/

	//int array[] = { 44,85,64,2,9,3,78 };
	//set<int> myset(array, array + 7);

	//set<int>::iterator it = myset.begin();
	//while (it != myset.end())
	//{
	//	cout << *it << " ";
	//	++it;
	//}
	//cout << endl;

	//set<int>::const_iterator cit = myset.cbegin();
	//while (cit != myset.cend())
	//{
	//	cout << *cit << " ";
	//	++cit;
	//}
	//cout << endl;

	////crbegin() 、crend()
	//set<int>::const_reverse_iterator crit = myset.crbegin();
	//while (crit != myset.crend())
	//{
	//	cout << *crit << " ";
	//	++crit;
	//}
	//cout << endl;

	//map<string, string> m;// 关联式容器，存储键值对
	//pair<string, string> kv1("left", "左边");// 简单的组合类型
	//m.insert(kv1);
	//
	//m.insert(pair<string, string>("right", "右边"));//匿名对象初始化
 //	m.insert(make_pair("insert", "插入"));

	//pair<string, string> kv2 = { "string", "字符串" };
	//m.insert({ "string", "字符串" });

	// 多参数的隐式类型转换
	//map<string, string> m = { {"left","左边"},{"right", "右边"},{"insert","插入"} };
	//map<string, string>::iterator it = m.begin();
	//while (it != m.end())
	//{
	//	cout << (*it).first << ":" << (*it).second << endl;
	//	++it;
	//}
	//cout << endl;

	//for (auto& e : m)
	//{
	//	cout << e.first << ":" << e.second << endl;
	//}
	//cout << endl;

	//string arr[] = { "苹果", "西瓜", "苹果", "西瓜", "苹果", "苹果", "西瓜", "苹果", "香蕉", "苹果", "香蕉" };
	//map<string, int> countTree;
	//for (const auto& str : arr)
	//{
	//	countTree[str]++;
	//}

	//for (const auto& e : countTree)
	//{
	//	cout << e.first << ":" << e.second << endl;
	//}
	//cout << endl;

	////int i = int();
	////int j = int(10);


	//map<string, string> m;
	//m.insert(pair<string, string>("peach", "桃子"));
	//m.insert(make_pair("sort", "排序"));

	//m["left"] = "左边";//修改+插入
	//m["left"] = "左边、剩余";// 修改

	//m["insert"];

	//cout << m["left"] << endl;

	


	 
	return 0;
}